using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class forums_Default : System.Web.UI.Page
{
    private EventHandler UserLoggedInHandler;
    private EventHandler UserLoggedOutHandler;

    protected void Page_Load(object sender, EventArgs e)
    {
        UserLoggedInHandler += new EventHandler(UserLoggedIn);
        UserLoggedOutHandler += new EventHandler(UserLoggedOut);
        Managers.UserLoginManager.Instance.OnUserLoggedIn += UserLoggedInHandler;
        Managers.UserLoginManager.Instance.OnUserLoggedOut += UserLoggedOutHandler;

        Page.Title = "FSTDT Forums";
        if (!Page.IsPostBack)
        {
            Refresh();
        }
    }

    protected void Load_Complete(object sender, EventArgs e)
    {
        Managers.UserLoginManager.Instance.OnUserLoggedIn -= UserLoggedInHandler;
        Managers.UserLoginManager.Instance.OnUserLoggedOut -= UserLoggedOutHandler;
    }

    private void Refresh()
    {
        //Forumgrid1.CurrentForum = null;
        Categories1.Refresh();
    }

    void UserLoggedIn(object sender, EventArgs e)
    {
        Refresh();
    }

    void UserLoggedOut(object sender, EventArgs e)
    {
        Refresh();
    }
}
